package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description NursingProjectMapper
 * @Author luohai
 * @Date 2024-10-15
 */
@Mapper
public interface NursingProjectMapper {

    /**
     * 护理项目分页查询
     * @param name
     * @param status
     * @return
     */
    Page<NursingProjectVo> nursingPaginationQuery(String name, Integer status);

    /**
     * 新增护理项目
     * @param bean
     */
    void addNursingProject(NursingProject bean);

    /**
     * 根据id查询护理项目（数据回显）
     * @param id
     * @return
     */
    @Select("select * from nursing_project where id = #{id}")
    NursingProjectVo searchNursingProjectById(Long id);

    /**
     * 修改护理项目
     * @param bean
     * @return
     */
    void modifyNursingProject(NursingProject bean);

    /**
     * 护理项目启禁用
     * @param id
     * @param status
     * @return
     */
    void startAndBan(Long id, Integer status);

    /**
     * 根据id删除护理项目
     * @param id
     * @return
     */
    @Delete("delete from nursing_project where id = #{id}")
    void deleteNursingProject(Long id);

    /**
     * 查询所有护理项目
     * @return
     */
    @Select("select * from nursing_project")
    List<NursingProjectVo> searchAll();
}
